Skip to content

Rollup of 11 pull requests #145334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Aug 13, 2025
Merged

Rollup of 11 pull requests #145334

merged 23 commits into from
Aug 13, 2025

Conversation

Kobzol
Copy link
Member

@Kobzol Kobzol commented Aug 13, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Kivooeo and others added 23 commits August 4, 2025 02:18
This is a documentation-only deprecation for now.
Over time, we can
- warn and then remove on use of unstable environment variables
- warn on use of stable environment variables (no plan to remove due to
  compatibility)

Longer term, we expect test runners, like `cargo test`, to provide the
necessary mechanisms for environmental or persistent configuration (e.g.
using cargo config which supports `.cargo/config.toml` as well as
environment variables).

This would include:
- `RUST_TEST_THREADS`
- `RUST_TEST_NOCAPTURE`
- `RUST_TEST_SHUFFLE` (unstable)
- `RUST_TEST_SHUFFLE_SEED` (unstable)

The primary outcomes for this change are
- Reducing the scope of what is expected for custom test harnesses to
  implement
- Reduce the mechanisms that test runners, like `cargo test`, are
  expected to track when they are being bypassed to protect against
  negative interactions, e.g.  `RUST_TEST_NOCAPTURE=1` when json output
  is being read.
Signed-off-by: Sacha Ayoun <[email protected]>
chore(ci): upgrade checkout to v5
…ross35

Add ASCII-related methods from `u8` and `MIN`/`MAX` to `core::ascii::Char`

* Add ASCII-related methods from `u8` to `core::ascii::Char`.
* Add `core::ascii::Char::MIN` and `core::ascii::Char::MAX`.
…hpratt

Constify `SystemTime` methods

This is separated out from rust-lang#143949 due to the fact that it touches nontrivial system code. While the same arithmetic methods on `Instant` could be made const, since that type explicitly cannot be constructed at const-time, we don't bother. However, due to the fact that `SystemTime::UNIX_EPOCH` exists, it can be useful to create other anchors at other points in time, and thus these methods should be possible to use in const context.

> Side comment: I would honestly like to just move every single implementation which is a thin wrapper over `Duration` or some integer clock into their own module which is tested on all targets, so that we don't have to worry about code for lower-tier targets not being tested. However, the comments in `std::sys_common` pointing out the desire to move things to `std::sys::common` confused me, particularly due to the fact that `std::sys::common` is taken from the hellish asterisk-import of `std::sys::pal::common` and others.
>
> I think that, for trivial types like this, we should just have a platform-independent module that can be tested on all platforms, to both ensure that the code is properly tested regardless of whether higher-tier platforms needed, and to avoid the extreme mental gymnastics required to determine where in the code it lies.
>
> However, since I'm not on any of the teams maintaining this code and am not involved, I'll settle for just copy-pasting like everyone else has been doing. I just want to express how I'm not happy about that.

**Reviewer note: please only pay attention to the last commit of this PR, until its blocker is merged.**

Since this depends on the previous PR:
`@rustbot` blocked
…ake, r=lcnr

editorconfig: don't trim trailing whitespace in tests

some test snapshot files require trailing whitespace, and previously manually editing those snapshot files (as is required for run-make tests and some platform-specific tests) in an editor with editorconfig support would cause that whitespace to be removed, [causing CI failures like this one](rust-lang#144596 (comment))
…gross35

Stabilize `path_file_prefix` feature

This stabilises `Path::file_prefix`, following the FCP in [tracking issue ](rust-lang#86319)

(FCP ended almost a year ago, so if it's needed for proccess we could rerun it)

Closes: rust-lang#86319
Deprecate RUST_TEST_* env variables

Like with rust-lang#139224, this is a documentation-only deprecation for now. Over time, we can
- warn and then remove on use of unstable environment variables
- warn on use of stable environment variables (no plan to remove due to compatibility)

Longer term, we expect test runners, like `cargo test`, to provide the necessary mechanisms for environmental or persistent configuration (e.g. using cargo config which supports `.cargo/config.toml` as well as environment variables).

This would include:
- `RUST_TEST_THREADS`
- `RUST_TEST_NOCAPTURE`
- `RUST_TEST_SHUFFLE` (unstable)
- `RUST_TEST_SHUFFLE_SEED` (unstable)

The primary outcomes for this change are
- Reducing the scope of what is expected for custom test harnesses to implement
- Reduce the mechanisms that test runners, like `cargo test`, are expected to track when they are being bypassed to protect against negative interactions, e.g.  `RUST_TEST_NOCAPTURE=1` when json output is being read.

For testing-devex FCP, see rust-lang/testing-devex-team#10

Fixes rust-lang/testing-devex-team#10

History
-------

At each step, I could not find evidence of design discussions on whether to support CLI, env, or both.  The first env variable seems to come from the fact that it was being forked out of an existing env variable that had a much wider scope.

At best, this seems like a way to offer a more persistent configuration for these flags but environment variables hidden away in libtest is a bit clunky and this seems like the wrong layer to handle this problem.

**Originally:** `RUST_THREADS` was respected by the Rust runtime and libextra/test got this for free

**2013:** rust-lang#7335 suggested splitting `RUST_TEST_TASKS` out of `RUST_THREADS`.  In that issue and the implementation (rust-lang#8823).

**2014:** rust-lang#13374 ask for support to disable capturing of stdout/stderr.  `--nocapture` and `RUST_TEST_NOCAPTURE` were added together.

**2015:** rust-lang#23525 renamed `RUST_TEST_TASKS` to `RUST_TEST_THREADS`

**2016:** rust-lang#25636 asked to configure `RUST_TEST_THREADS` via `--test-threads` which was implemented in rust-lang#35414

**2021:** rust-lang#85440 asked for test randomization which was implemented in rust-lang#89082, adding `--shuffle` / RUST_TEST_SHUFFLE` and `--shuffle-seed SEED` / `RUST_TEST_SHUFFLE_SEED`

Potentially relevant issues
---------------------------

- rust-lang#74845
…=fmease

Remove unused `#[must_use]`

Self-explanatory

Fixes rust-lang#145257
chore(ci): upgrade checkout to v5

Maintenance update to actions/checkout@v5 to align with the current runner stack (Node 24); nothing else modified.

Release notes: https://github.com/actions/checkout/releases/tag/v5.0.0
Docs: Link to payload_as_str() from payload().
Adjust documentation of `dangling`

I believe the current doc of `dangling` is slightly off as it indicates:
`Note that the pointer value may potentially represent a valid pointer to a T`

The returned pointer has no provenance, so it may not be a valid pointer (except in the case of ZSTs, but I don't think this is what the documentation is trying to warn about).

See: https://rust-lang.zulipchat.com/#narrow/channel/136281-t-opsem/topic/Dangling.20pointers.3A.20definition

The value returned by dangling may never be used to dereference a value that isn't a ZST, even if address equality is detected with that of a valid pointer.
This is a minor fix, but this doc still got me confused for a second
Add `cast_init` and `cast_uninit` methods for pointers

ACP: rust-lang/libs-team#627
Tracking issue: rust-lang#145036

This includes an incredibly low-effort search to find uses that could be switched to using these methods. I only searched for `cast::<\w>` and `cast::<MaybeUninit` because there would otherwise be way too much to look through, and I also didn't modify anything inside submodules/subtrees.
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-meta Area: Issues & PRs about the rust-lang/rust repository itself O-hermit Operating System: Hermit O-SGX Target: SGX O-solid Operating System: SOLID O-unix Operating system: Unix-like labels Aug 13, 2025
@rustbot rustbot added O-wasi Operating system: Wasi, Webassembly System Interface O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Aug 13, 2025
@Kobzol
Copy link
Member Author

Kobzol commented Aug 13, 2025

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Aug 13, 2025

📌 Commit 8cb78fe has been approved by Kobzol

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2025
@bors
Copy link
Collaborator

bors commented Aug 13, 2025

⌛ Testing commit 8cb78fe with merge 1c9952f...

@bors
Copy link
Collaborator

bors commented Aug 13, 2025

☀️ Test successful - checks-actions
Approved by: Kobzol
Pushing 1c9952f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 13, 2025
@bors bors merged commit 1c9952f into rust-lang:master Aug 13, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 13, 2025
@Kobzol Kobzol deleted the rollup-fs5a133 branch August 13, 2025 10:39
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing b1b26b8 (parent) -> 1c9952f (this PR)

Test differences

Show 127 test diffs

127 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 1c9952f4dd6e0947ee91f07130c03813a088a894 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-x86_64-apple: 7470.2s -> 10250.8s (37.2%)
  2. x86_64-apple-1: 6638.2s -> 8380.7s (26.3%)
  3. dist-apple-various: 4195.7s -> 5126.6s (22.2%)
  4. dist-aarch64-apple: 5594.7s -> 6363.1s (13.7%)
  5. i686-gnu-1: 8247.8s -> 9191.5s (11.4%)
  6. x86_64-apple-2: 4569.2s -> 5030.0s (10.1%)
  7. pr-check-1: 1684.4s -> 1846.5s (9.6%)
  8. aarch64-msvc-1: 7216.6s -> 6597.4s (-8.6%)
  9. aarch64-gnu-llvm-19-1: 3420.0s -> 3684.1s (7.7%)
  10. dist-loongarch64-linux: 6014.8s -> 6470.9s (7.6%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#143467 Add ASCII-related methods from u8 and MIN/MAX to `cor… 4dafa6548b4cbc596c586372ce849a0a2ae096f7 (link)
#144519 Constify SystemTime methods 42abdfd13adabe85cb65541c6d8a17437f916b7f (link)
#144642 editorconfig: don't trim trailing whitespace in tests d627b38d9330a517d943fa9b0511accfe63b97a3 (link)
#144870 Stabilize path_file_prefix feature 71e39bcac4f27a40da5bffb9f137d5f5e3c293ad (link)
#145269 Deprecate RUST_TEST_* env variables f4a91c891d81ecb1d03f87c84fd962c952dcb6bd (link)
#145274 Remove unused #[must_use] be256a6cd909505b8f36058ae7a36a65d546937c (link)
#145289 chore(ci): upgrade checkout to v5 cd1cbb28ab7d9f94ddae2343af762cf96013410d (link)
#145303 Docs: Link to payload_as_str() from payload(). caa7a77b452c6ed453b7d1d8b96daa4b68fc653e (link)
#145308 Adjust documentation of dangling a617d6460875a5bd5f163faf0b19dbd384ac4503 (link)
#145320 Allow cross-compiling the Cranelift dist component 6046d4a40079de3155f3d7a87ae3cdaa174464e5 (link)
#145325 Add cast_init and cast_uninit methods for pointers 0acfe187ef36b84c2d6c9c9439ea84a8f7429675 (link)

previous master: b1b26b834d

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1c9952f): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 1.4%, secondary 3.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.4% [1.4%, 1.5%] 2
Regressions ❌
(secondary)
3.1% [3.1%, 3.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.4% [1.4%, 1.5%] 2

Cycles

Results (secondary 5.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.4% [5.4%, 5.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 464.328s -> 465.78s (0.31%)
Artifact size: 377.44 MiB -> 377.44 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-meta Area: Issues & PRs about the rust-lang/rust repository itself merged-by-bors This PR was explicitly merged by bors. O-hermit Operating System: Hermit O-SGX Target: SGX O-solid Operating System: SOLID O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-windows Operating system: Windows rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.